#include <stdio.h>

// 判断是否为回文数
int loop(int x)
{
    int original = x, reversed = 0;
    while (x != 0) {
        reversed = reversed * 10 + x % 10;
        x /= 10;
    }
    return original == reversed;
}

int main(void)
{
    int a, b;
    scanf("%d%d", &a, &b);
    for (int i = a; i <= b; i++) {
        if (i % 2 == 0 && loop(i))
            printf("%d\n", i);
    }
    return 0;
}